<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>let</title>
</head>

<body>
    <script>
        //变量不能重复声明
        let a;
        let b, c, d;
        // let a;

        // 块儿级作用域，函数，全局，eval
        // if  else while for 花括号分割
        // {
        //     let girl = "NaNa"
        // }
        // console.log(girl);

        // 不存在变量提升
        //  console.log(sing);//报错：Uncaught ReferenceError: Cannot access 'sing' before initialization
        let sing = "Uiii";
        console.log(sing);

        console.log(song);
        var song = "taipei";


        // 不影响作用域链
        {
            let school = "SWPU";
            function fn() {
                console.log(school);
            }
        }

    </script>
</body>

</html>